package com.xxwy.springboot.webflux.document;

import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;

/**
 * @author xxwy
 */
@Document(collection = "user")
@Data
public class User {
    @Id
    private String id;
    @NotEmpty
    private String name;

//    @Max(100)
//    @Min(0)
    @Range(max = 100, min = 10)
    private int age;
}
